package cn.xllyd.exception;

import lombok.Data;

@Data
public class GlobalException extends RuntimeException{
    private String errorCode;
    public GlobalException(){
    }

    public GlobalException(String message) {
        super(message);
    }

    public GlobalException(String message,String errorCode) {
        super(message);
        this.errorCode = errorCode;
    }

    /**
     * 重写方法
     * @param e
     */
    public GlobalException(GlobalExceptionCodeEnum e) {
        super(e.getMessage());
        this.errorCode = e.getCode();
    }
}
